#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTimer>
#include <QString>
#include <QFile>

#include <fstream>
#include <string>

#include "dialog.h"

using namespace std;

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

public slots:
    void timeUpdate();
    void tomatoUpdate();

private slots:
    void on_startButton_clicked();
    void on_stopButton_clicked();
    void writeLog(const QString &log_line);

    void on_recordButton_clicked();

signals:
    void tomatoTimeOut(const QString &str);

private:
    QTimer *timer;
    int timeCnt, tomatoCnt;
    const static int work = 25*60;
    const static int free = 5*60;
    fstream flog;
    string file_name;
    bool work_flag;
    Dialog *logView;

    Ui::Widget *ui;

};

#endif // WIDGET_H
